package com.study.spmongodb.convert;

/**
 * @author study
 * @version 1.0
 * @date 2020/10/11 23:03
 */

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

@Mapper
public interface CarMapper {
    CarMapper INSTANCE = Mappers.getMapper(CarMapper.class);

    @Mapping(source = "numberOfSeats", target = "seatCount")
    CarDto carToCarDto(Car car);

    // @Mapping(source = "seatCount", target = "numberOfSeats")
    Car carDto2car(CarDto carDto);
}
